import Q from 'q'
import axios from 'axios'
import envFuncs from '@/config/base'
let env = envFuncs.getParams()
import { S, U, getRequestId, mapField } from '../../lib/backend'

export default {
  getCourseList ({rootState}, info) {
    let CRM_API_HOST = env.CRM_API_HOST
    // let CRM_API_HOST = ' http://rap.taobao.org/mockjsdata/18476'
    let url = CRM_API_HOST + '/sites/' + rootState.app.site_id + '/users/' + rootState.app.token + '/course_list' + '?' + U(info || {}, false)
    // let url = 'http://rap2api.taobao.org/app/mock/2717/GET//example/1514357201480'
    return axios.get(url)
  },
  getClueYuYueType ({rootState}, info) {
    let CRM_API_HOST = env.CRM_API_HOST
    let url = CRM_API_HOST + '/sites/' + rootState.app.site_id + '/users/' + rootState.app.token + '/yy_type' + '?' + U(info || {}, false)
    return axios.get(url)
  }
}
